package net.bmwgroup.easyrule.demo.actions;

import net.bmwgroup.easyrule.demo.facts.BaseDimension;
import org.jeasy.rules.api.Action;
import org.jeasy.rules.api.Facts;

public class AirConditionerAction implements Action {
    private Facts facts;

    public AirConditionerAction(Facts facts) {
        this.facts = facts;
    }

    @Override
    public void execute(Facts facts) {
        System.out.println("Temperature has been reached " + ((BaseDimension) facts.get("temperature")).getDataValue() + " centigrade");
        System.out.println("Air conditioner has been opened");
    }
}
